---@class HeightControl_C:UUserWidget
---@field Button_38 UButton
---@field Button_40 UButton
--Edit Below--
local HeightControl = { bInitDoOnce = false; };
local height = 3;

function HeightControl:Construct()
    self:InitBindEvent();
end

function HeightControl:InitBindEvent()
    self.Button_38.OnClicked:Add(self.High_Button_OnClicked, self);
    self.Button_40.OnClicked:Add(self.Low_Button_OnClicked, self);
end

function HeightControl:UnitBindEvent()
    self.Button_38.OnClicked:RemoveaAl(self.High_Button_OnClicked, self);
    self.Button_40.OnClicked:RemoveaAl(self.Low_Button_OnClicked, self);
end

function HeightControl:High_Button_OnClicked()
    local PlayerController = GameplayStatics.GetPlayerController(self, 0);
    if PlayerController ~= nil and height<3 then
        height = height + 1;
        PlayerController:SetCameraHeight(height);
    end
end

function HeightControl:Low_Button_OnClicked()
    local PlayerController = GameplayStatics.GetPlayerController(self, 0);
    if PlayerController ~= nil and height>1 then
        height = height - 1;
        PlayerController:SetCameraHeight(height);
    end
end

return HeightControl;